]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
polkitAgent: Destroy session from dialogue closed handler
authorPhilip Withnall <withnall@endlessm.com>
Mon, 21 Jan 2019 18:11:59 +0000 (18:11 +0000)
committerFlorian Müllner <florian.muellner@gmail.com>
Thu, 24 Jan 2019 14:48:48 +0000 (14:48 +0000)
Rather than explicitly destroying the session after calling close(),
destroy it from the `closed` signal handler.

This also means we can make the method internal.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/357

js/ui/components/polkitAgent.js

index f03af35fc8e3a60a2e977b548755217503a1bd30..7f38e122e3e1f75660dd241a5616fcb7a022b990 100644 (file)
@@ -168,7 +168,7 @@ var AuthenticationDialog = new Lang.Class({
     },
 
     performAuthentication() {
-        this.destroySession();
+        this._destroySession();
         this._session = new PolkitAgent.Session({ identity: this._identityToAuth,
                                                   cookie: this._cookie });
         this._sessionCompletedId = this._session.connect('completed', this._onSessionCompleted.bind(this));
@@ -300,7 +300,7 @@ var AuthenticationDialog = new Lang.Class({
         this._ensureOpen();
     },
 
-    destroySession() {
+    _destroySession() {
         if (this._session) {
             if (!this._completed)
                 this._session.cancel();
@@ -331,6 +331,8 @@ var AuthenticationDialog = new Lang.Class({
         if (this._sessionUpdatedId)
             Main.sessionMode.disconnect(this._sessionUpdatedId);
         this._sessionUpdatedId = 0;
+
+        this._destroySession();
     },
 });
 Signals.addSignalMethods(AuthenticationDialog.prototype);
@@ -401,7 +403,6 @@ var AuthenticationAgent = new Lang.Class({
 
     _completeRequest(dismissed) {
         this._currentDialog.close();
-        this._currentDialog.destroySession();
         this._currentDialog = null;
 
         if (this._sessionUpdatedId)